﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using AutoMapper;

namespace FazaDemo.PL.Mapping
{
    public class ContainerElementMapper<TFrom, TTo> : IContainerElementMapper<TFrom, TTo>
    {

        public IEnumerable<TTo> MapFrom(IEnumerable<TFrom> from)
        {
            var result = new List<TTo>();
            foreach (var fr in from)
            {
                result.Add(Mapper.Map<TFrom, TTo>(fr));
            }
            return result;
        }

    }
}
